
/**
 * 当前月份开始时间
 * @returns {Date}
 */
export function getStartOfMonth() {
    let now = new Date();
    return new Date(now.getFullYear(), now.getMonth(), 1, 0, 0, 0, 0);
}

/**
 * 当前月份结束时间
 * @returns {Date}
 */
export function getEndOfMonth() {
    let now = new Date();
    let nextMonth = now.getMonth() + 1;
    let nextMonthYear = now.getFullYear();
    if (nextMonth > 11) {
        nextMonth = 0;
        nextMonthYear++;
    }
    return new Date(nextMonthYear, nextMonth, 0, 23, 59, 59, 59);
}
